package com.home.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.home.service.UserService;
import com.home.service.Impl.UserServiceImpl;

@Controller
public class LoginController {

	@Autowired
	private UserServiceImpl userServer;

	@RequestMapping("login.do")
	public String login(String username, String password) {
		String pwd = userServer.getPassWordByName(username);
		System.out.println("1:" + password);
		System.out.println(pwd);
		if (pwd != null) {
			if (pwd.equals(password)) {
				System.out.println(username + " 登录成功");
				return "success";// 逻辑视图名 跳转页面默认为转发

			}
		}

		return "error";
	}
}
